<template>
  <div class="page-news-detail-main">
    <ComBanner :bannerText="detailText" />
    <!-- 新闻内容 -->
    <NewsInfoText :headerInfo="headerInfo" :contantInfo="contantInfo" />
  </div>
</template>

<script>
import { NewsDetailApi } from "@/api/api";
import NewsInfoText from "./components/newsDetil/NewsInfoText.vue";
export default {
  name: "NewsDetail",
  components: { NewsInfoText },
  data() {
    return {
      detailText: {},
      headerInfo: {},
      contantInfo: {},
      newsId:''
    };
  },
  mounted() {
    this.newsId = this.$route.query.newsId
    this.getNewsDetail();
    
    console.log(this.$route.query.newsId)
  },
  methods: {
    getNewsDetail() {
      NewsDetailApi.newsDetail({newsId:this.newsId}).then((res) => {
        const { detailText, headerInfo, contantInfo } = res.data;
        this.detailText = detailText;
        this.headerInfo = headerInfo;
        this.contantInfo = contantInfo;
        // console.log(456, this.detailText, this.headerInfo, this.contantInfo);
      });
    },
  },
};
</script>

<style scoped lang="less">
</style>